# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=pth
pkgver=2.0.7
pkgrel=5
pkgdesc="GNU Portable Threads"
options="!libc_musl" # This is only for uclibc
url="https://www.gnu.org/software/pth"
arch="all"
license="LGPL-2.1-or-later"
subpackages="$pkgname-dev $pkgname-doc"
source="https://ftp.gnu.org/gnu/pth/pth-$pkgver.tar.gz
	pth-2.0.5-parallelfix.patch
	pth-2.0.6-ldflags.patch
	pth-2.0.6-sigstack.patch
	"

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--mandir=/usr/share/man
	make
}

package() {
	make -j1 DESTDIR="$pkgdir" install
}

sha512sums="f79d74047c50e06f3198356f88647c5c1c8a04ebdd94641fc31d5ab0fd2750d86615fcb81da2f98d7ea73d012a501195d3fa09060571d18dcfdaec5d7a0ecb12  pth-2.0.7.tar.gz
bda7d23a6dd15097c72428003ece7e453b8c1791573853a711dda7bb432593d847053bef436b55050f4a80edd7574e1178ef9fbe001eb20d91c717b8cae43957  pth-2.0.5-parallelfix.patch
099c8221d0011dd5284a96d216ed5315619ae377c3c0a01d15af2976aec57e286166601740b139852f340b36fdc7c5ce62f69faf268d6feaabe70db2bbfdf372  pth-2.0.6-ldflags.patch
0011405ae5e8371390adb2a718277d675db5bc085fe5c5f6054ba1bb08f2276d9e5f4d5c083e833417893173210b1e791a2d0f0a9b6d13194f11c9f587397635  pth-2.0.6-sigstack.patch"
